<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>GLTF Plugin API reference</title>
<link rel="stylesheet" type="text/css" href="../../helpFiles/style.css">
<script type="text/javascript">
//
function getParameterByName(name, url = window.location.href)
{
    name = name.replace(/[\[\]]/g, '\\$&');
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
        results = regex.exec(url);
    if(!results) return null;
    if(!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
//
                </script><style type="text/css">
td.section { margin: 0; padding: 0; }
                </style>
</head>
<body>
<div align="center"><table class="allEncompassingTable">
<tr><td id="title" class="section"><h1>GLTF Plugin API reference</h1></td></tr>
<tr><td id="info" class="section"><p class="infoBox">Plugin for glTF format support</p></td></tr>
<tr><td id="alphabetical" class="section"><pre class="lightGreyBox"><a href="?#animationFrameCount">simGLTF.animationFrameCount</a>
<a href="?#clear">simGLTF.clear</a>
<a href="?#exportAllObjects">simGLTF.exportAllObjects</a>
<a href="?#exportAnimation">simGLTF.exportAnimation</a>
<a href="?#exportObject">simGLTF.exportObject</a>
<a href="?#exportObjects">simGLTF.exportObjects</a>
<a href="?#exportSelectedObjects">simGLTF.exportSelectedObjects</a>
<a href="?#exportShape">simGLTF.exportShape</a>
<a href="?#loadASCII">simGLTF.loadASCII</a>
<a href="?#loadBinary">simGLTF.loadBinary</a>
<a href="?#recordAnimation">simGLTF.recordAnimation</a>
<a href="?#saveASCII">simGLTF.saveASCII</a>
<a href="?#saveBinary">simGLTF.saveBinary</a>
<a href="?#serialize">simGLTF.serialize</a>
</pre></td></tr>
<tr><td id="commands" class="section">
<h3 class="subsectionBar">
<a name="animationFrameCount" id="animationFrameCount"></a>simGLTF.animationFrameCount</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Return count of animation frames.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int count=simGLTF.animationFrameCount()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>count</strong> (int): count of frames</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="clear" id="clear"></a>simGLTF.clear</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Clear all data stored in memory (geometry, material, animation, cache).</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.clear()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportAllObjects" id="exportAllObjects"></a>simGLTF.exportAllObjects</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export all objects to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportAllObjects()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportAnimation" id="exportAnimation"></a>simGLTF.exportAnimation</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export animation data to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportAnimation()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportObject" id="exportObject"></a>simGLTF.exportObject</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export object to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int nodeIndex=simGLTF.exportObject(int objectHandle)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>objectHandle</strong> (int): handle of the object</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>nodeIndex</strong> (int): index of the new node (may contain sub-nodes)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportObjects" id="exportObjects"></a>simGLTF.exportObjects</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export objects to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportObjects(table[] objectHandles)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>objectHandles</strong> (table of int): handles of the objects</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportSelectedObjects" id="exportSelectedObjects"></a>simGLTF.exportSelectedObjects</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export selected objects to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.exportSelectedObjects()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="exportShape" id="exportShape"></a>simGLTF.exportShape</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export shape to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">int nodeIndex=simGLTF.exportShape(int shapeHandle, int parentHandle=-1, int parentNodeIndex=0)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">
<div>
<strong>shapeHandle</strong> (int): handle of the shape</div>
<div>
<strong>parentHandle</strong> (int, default: -1): handle of the parent object. if specified the matrix of the node will be relative to this. use this in conjunction with parentNodeIndex parameter.</div>
<div>
<strong>parentNodeIndex</strong> (int, default: 0): index of parent node</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>nodeIndex</strong> (int): index of the new node (may contain sub-nodes)</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="loadASCII" id="loadASCII"></a>simGLTF.loadASCII</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Load an ASCII glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result, string warnings, string errors=simGLTF.loadASCII(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>result</strong> (bool): true if success</div>
<div>
<strong>warnings</strong> (string): warning message(s)</div>
<div>
<strong>errors</strong> (string): error message(s)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="loadBinary" id="loadBinary"></a>simGLTF.loadBinary</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Load a binary (.glb) glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result, string warnings, string errors=simGLTF.loadBinary(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">
<div>
<strong>result</strong> (bool): true if success</div>
<div>
<strong>warnings</strong> (string): warning message(s)</div>
<div>
<strong>errors</strong> (string): error message(s)</div>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="recordAnimation" id="recordAnimation"></a>simGLTF.recordAnimation</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Export animation data to glTF model.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">simGLTF.recordAnimation(bool enable)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>enable</strong> (bool): if true the plugin will record the pose of all objects during simulation</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="saveASCII" id="saveASCII"></a>simGLTF.saveASCII</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Save a glTF model to an ASCII file.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result=simGLTF.saveASCII(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>result</strong> (bool): true if success</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="saveBinary" id="saveBinary"></a>simGLTF.saveBinary</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Save a glTF model to a binary file.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">bool result=simGLTF.saveBinary(string filepath)<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam"><div>
<strong>filepath</strong> (string): </div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>result</strong> (bool): true if success</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br><h3 class="subsectionBar">
<a name="serialize" id="serialize"></a>simGLTF.serialize</h3>
<table class="apiTable">
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                    Description
                                                </td>
<td class="apiTableRightDescr">Serialize glTF model to JSON string.</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLSyn">Lua synopsis</td>
<td class="apiTableRightLSyn">string json=simGLTF.serialize()<br>
</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLParam">Lua parameters</td>
<td class="apiTableRightLParam">-</td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftLRet">Lua return values</td>
<td class="apiTableRightLRet"><div>
<strong>json</strong> (string): the JSON document</div></td>
</tr>
<tr class="apiTableTr">
<td class="apiTableLeftDescr">
                                                See also
                                            </td>
<td class="apiTableRightDescr"></td>
</tr>
</table>
<br>
</td></tr>
<tr><td id="enums" class="section"></td></tr>
<tr><td id="structs" class="section"></td></tr>
<tr><td id="scriptFunctions" class="section"></td></tr>
</table></div>
<script type="text/javascript">
//
view = getParameterByName('view')
document.getElementById('alphabetical').style.display = view == 'alphabetical' ? 'table-cell' : 'none'
document.getElementById('commands').style.display = view == null ? 'table-cell' : 'none'
document.getElementById('enums').style.display = view == null ? 'table-cell' : 'none'
document.getElementById('structs').style.display = view == null ? 'table-cell' : 'none'
document.getElementById('scriptFunctions').style.display = view == null ? 'table-cell' : 'none'
//
                </script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/highlight.min.js"></script><script type="text/javascript">
//
document.addEventListener('DOMContentLoaded', (event) => {
    document.querySelectorAll('code.hljs').forEach((block) => {
        hljs.highlightBlock(block);
    });
});
//
                </script>
</body>
</html>
